#include "stdafx.h"
#include "graph.h"

using std::vector;


int * CGraph::Dijkstra( int u ) {

	int cV = GetCountV();
	int * d = new int[ cV ];
	/*vector< int, int > Q;


	for ( int i=0; i<cV; ++i ) {

		d[ i ] = UINT_MAX;

		Q.push_back( i, d[ i ] );
	}
	
	d[ u ] = 0;

	while( !Q.empty()) {

		vector< int, int >::iterator itr;
		int min = INT_MAX;
		int im = 0;


		for ( itr = Q.begin(); itr!=Q.end(); ++itr ) {

			if( *itr < min ) {

				min = *itr;
				im = itr;
			}
		}

		vector< int > neighbours = GetNeighbours( im );
		vector< int >::iterator itr;
		
		for ( itr = neighbours.begin(); itr!=neighbours.end(); ++itr ) {
		
			if( d[ im ] > d[ *itr ] + GetWeight( im, *itr ) ) {
			
				d[ im ] = d[ *itr ] + GetWeight( im, *itr );
			}
		}
	}*/

	
	return d;
}